package com.logistics.treatment.controller;

import com.logistics.treatment.entity.model.TreatmentSave;
import com.logistics.treatment.service.HeatTreatmentService;
import com.logistics.utils.exception.MessageException;
import com.logistics.utils.response.ResponseUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/lgs/heat/treatment/")
public class HeatTreatmentController {

    @Resource
    HeatTreatmentService service;

    /**
     * 开始配送创建配送单
     * @return ResponseEntity
     */
    @PostMapping("/create")
    public ResponseEntity create(@RequestBody TreatmentSave treatmentSave) throws MessageException {
        service.createDelivery(treatmentSave);
        return ResponseUtil.success("success");
    }

}